package thread;

/**
 * 创建线程方式一
 *
 * @author dingwen
 * @date 2021/08/30
 */
public class CreateThread1 extends Thread {
    @Override
    public void run() {
        // 获取当前线程名称
        System.out.println("Thread.currentThread().getName() = " + Thread.currentThread().getName());
        System.out.println("创建了一个新的线程");
    }

    public static void main(String[] args) {
        // main 线程
        System.out.println("Thread.currentThread().getName() = " + Thread.currentThread().getName());
        CreateThread1 thread1 = new CreateThread1();
        thread1.start();
    }
}
